
import {getLoadingCount} from '@/utils/global.js'


export const state = () => ({
  keepLoading: false,
	needRefreshMenuList: [], // 当前需要刷新的路由菜单信息数组
  isRefresh: false, // 当前是否属于刷新中
})

export const mutations = {
	// 打开loading动画
  openLoading (state) {
    state.keepLoading = true
  },
  // 关闭loading动画
  closeLoading (state) {
    setTimeout(() => {
      if(getLoadingCount() == 0) {
        state.keepLoading = false
      }
    }, 100)
  },
	 // 设置需要刷新的路由菜单信息
	 setNeedRefreshMenuList (state, data) {
    state.needRefreshMenuList = data;
  },
  // 设置刷新状态
  setRefreshStatus (state, data) {
    state.isRefresh = data;
  },
}

export const actions = {
	
	
}
